package com.neuedu.dao.impl;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.neuedu.dao.GoodsDao;
import com.neuedu.dao.Goods_typeDao;
import com.neuedu.model.Goods_type;

//把dao接口实现类，交给spring进行管理
@Repository
public class Goods_typeDaoImpl implements Goods_typeDao {

	//代码层级的整合spring+mybatis
	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;
	
	public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
		this.sqlSessionTemplate = sqlSessionTemplate;
	}
	
	@Override
	public int countGoods_type() {
		return sqlSessionTemplate.getMapper(Goods_typeDao.class).countGoods_type();
	}

	@Override
	public List<Goods_type> findAll(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(Goods_typeDao.class).findAll(map);
	}

	@Override
	public int addGoods_type(Goods_type u) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(Goods_typeDao.class).addGoods_type(u);
	}

	@Override
	public int updateGoods_type(Goods_type u) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(Goods_typeDao.class).updateGoods_type(u);
	}

	@Override
	public int deleteGoods_type(int id) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(Goods_typeDao.class).deleteGoods_type(id);
	}

	@Override
	public List<Goods_type> findList() {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(Goods_typeDao.class).findList();
	}

}
